﻿using Elastic.Clients.Elasticsearch;
using Elastic.Clients.Elasticsearch.QueryDsl;
using Elasticsearch.Model;

namespace Elasticsearch.Service
{
    public interface IUserService
    {
        //// 添加文档
        Task<bool> AddUserAsync(User user);

        // 查询文档（by ID）
        Task<User?> GetUserAsync(string id);

        //// 删除文档
        Task<bool> DeleteUserAsync(string id);

        //查询列表（分页 + 条件：状态为1）
        Task<List<User>> SearchUsersAsync(string? keyword = null, int page = 1, int size = 10);

        /// <summary>
        /// 聚合查询
        /// </summary>
        /// <returns></returns>
        Task<object> SerachAgretetion();

        /// <summary>
        /// 自动补全添加数据
        /// </summary>
        /// <returns></returns>
        Task<bool?> AutocompletionAddData();

        /// <summary>
        /// 获取数据
        /// </summary>
        /// <returns></returns>
        Task<bool?> GetAutocompletionData();
    }
}
